﻿<%@ Page Title="" Language="C#" MasterPageFile="~/LoggedPrivate.Master" AutoEventWireup="true" CodeBehind="PrivateAccount.aspx.cs" Inherits="PL___Web_Application.PrivateAccount" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <style type="text/css">
 .save_bt
        {
            width: 100px;
            height: 30px;
            background-image: url('grafics/save.png');
            background-color: transparent;
            border: 0;
            background-repeat: no-repeat;
            z-index: 5;
        }
        .save_bt:hover
        {
            background-image: url('grafics/save_hover.png');
        }
         .TableRow
        {
            background-color: #DCDCDC;
            color: #000000;
            height:16px;
        }
        .TableRow:hover
        {
            background-color: #0099CC;
            cursor: pointer;
        }
        .ColumnTitle
        {
            height: 35px;
            font-size: 14px;
            font-weight: bold;
            text-transform: uppercase;
            text-align: center;
              background-color: #bbbbbb;
            color: #ffffff;
        }
      
.ListTable
        {
            margin-left: auto;
            margin-right: auto;            
            width:510px;
            border:5 solid #aaaaaa; 
            border-collapse:collapse;
            
        }
         
        </style>
         <script type="text/javascript" language="javascript">

             //To preload images
             Img1 = new Image();
             Img1.src = "grafics/save_hover.png";
          

    </script>
    <script type="text/javascript">
        function viewcar(id) {

            window.location = "ViewCar.aspx?id=" + id
        }

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentplaceholder" runat="server">
    <br />
<br />
<h1>My Account Details:</h1>
 <table cellpadding="2" cellspacing="7">
                <tr>
                    <td>
                        <b>Username:</b>
                    </td>
                    <td>
                        <asp:TextBox ID="username_tb" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Password:</b>
                    </td>
                    <td>
                        <asp:TextBox ID="password_tb" runat="server" TextMode="Password"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Name</b></td>
                    <td>
                          <asp:TextBox ID="name_tb" runat="server"></asp:TextBox>
                 
                       
                    </td>
                    <td>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td>
                       <b>CPR</b> </td>
                    <td>
                        <asp:TextBox ID="cpr_tb" runat="server"></asp:TextBox>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                       <b>Address</b> </td>
                    <td>
                       <asp:TextBox ID="address_tb" runat="server"></asp:TextBox>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        <b>Phone</b></td>
                    <td>
                        <asp:TextBox ID="phone_tb" runat="server"></asp:TextBox>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                       <b>Age</b> </td>
                    <td>
                         <asp:TextBox ID="age_tb" runat="server"></asp:TextBox>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                       <b>Sex</b></td>
                    <td>
                        <asp:DropDownList ID="sex_cb" runat="server">
                            <asp:ListItem>Female</asp:ListItem>
                            <asp:ListItem>Male</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <br />
                        <asp:Button runat="server" ID="save_button" Text="" class="save_bt" OnClick="Save_Changes" />
                       
                        </td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
            <asp:Label ID="error_lb" runat="server" ForeColor="Red"></asp:Label>

    <br />
    <br />
    <div id="purchasedcars">
        <h2>My Purchased Cars</h2>
          <asp:ListView ID="ListView1" runat="server" DataSourceID="CarListSource">
                        <ItemTemplate>
                            <tr class="TableRow" onclick="viewcar('<%# Eval("Vehicle.reg_number")%>')">
                                <td>
                                    <asp:Label ID="TypeCar" runat="server" Text="" typecarid='<%# Eval("type_car") %>'
                                        OnPreRender="GetTypeCar" ClientIDMode="Static" />
                                </td>
                                <td>
                                    <asp:Label ID="Fuel" runat="server" Text="" fuelid='<%# Eval("Vehicle.fuel") %>'
                                        OnPreRender="GetFuel" ClientIDMode="Static" />
                                </td>
                                <td>
                                    <%# Eval("Vehicle.colour") %>
                                </td>
                                <td>
                                    <%# Eval("doors_number") %>
                                </td>
                                <td>
                                    <%# Eval("Vehicle.price") %>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <LayoutTemplate>
                           <table id="itemPlaceholderContainer" runat="server" class="ListTable" border="1">
                                <tr id="Tr1" runat="server" style="background-color: #DCDCDC; color: #000000;">
                                    <th id="Th1" runat="server">
                                        <div class='ColumnTitle'>
                                            Type
                                        </div>
                                    </th>
                                    <th id="Th2" runat="server">
                                        <div class='ColumnTitle'>
                                            Fuel
                                        </div>
                                    </th>
                                    <th id="Th3" runat="server">
                                        <div class='ColumnTitle'>
                                            Colour
                                        </div>
                                    </th>
                                    <th id="Th4" runat="server">
                                        <div class='ColumnTitle'>
                                            Num. Doors
                                        </div>
                                    </th>
                                    <th id="Th5" runat="server">
                                        <div class='ColumnTitle'>
                                            Price
                                        </div>
                                    </th>
                                </tr>
                                <tr id="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </LayoutTemplate>
                    </asp:ListView>
                    <asp:ObjectDataSource ID="CarListSource" runat="server" SelectMethod="purchasedCarsList"
                        TypeName="PL___Web_Application.PrivateAccount"></asp:ObjectDataSource>
    </div>
</asp:Content>
